import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Err from '../views/404.vue'
import Index from '../views/Index.vue'
import Nav from '../views/Nav.vue'
import Home from '../views/Home.vue'
import Patch from '../views/Patch.vue'
import Hp from '../views/Hp.vue'

const routes = [

  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/index',
    name: 'Index',
    component: Index
  },
  {
    path: '/Nav',
    component: Nav,
    children:[
      {
        path: '',
        name: 'home',
        component: Home
      },
      {
        path: 'patch',
        name: 'patch',
        component: Patch
      },
      {
        path: 'hp',
        name: 'hp',
        component: Hp
      },
      
    ]
  },
  {          /*这里设置404页面，放在最后*/
    path: '/:pathMatch(.*)*',
    name: 'Err',
    component: Err
  },
 
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
